//
// Created by wy on 2023/12/9.
//
#include "logutil.h"
#include <stdio.h>
#include <direct.h>
#include <windows.h>

void getCurrnetExcuteAbsolutePath(char **absolutePath) {
    int *p=1;
    printf("*p的指针长度:%d\n",sizeof(p));
    char path_getbycwd[512] = {};
    char *path = getcwd(path_getbycwd, sizeof(path_getbycwd) - 1);
    if (path == NULL) {
        perror("get cwd error");

    }
    printf("buf:%s\n", path_getbycwd);
    *absolutePath=path;

    char path_whole[300] = {};
    GetModuleFileName(NULL, path_whole, sizeof(path_whole) - 1);
    printf("path_whole:%s\n", path_whole);

    printf("absolutePath is %s\n",*absolutePath);
}

/**
 * 读取程序运行目录下的配置文件 config.ini文件的信息
 * 然后按配置节点的信息读取
 * @param config_file_path
 * @param key
 * @param section
 */
void readIniConfigValue(char *config_file_path, char *key, char *section)
{
    char *execute_path=NULL;
    getCurrnetExcuteAbsolutePath(&execute_path);
    if(execute_path!=NULL)
    {
        //Path_file=strncpy(execute_path,config_file_path,)
    }
}

